package io.renren.modules.lanling.service.impl;

import io.renren.modules.lanling.dao.SchoolDao;
import io.renren.modules.lanling.entity.SchoolEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.lanling.service.SchoolService;


@Service("shoolService")
public class SchoolServiceImpl extends ServiceImpl<SchoolDao, SchoolEntity> implements SchoolService {


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        //todo 自定义分页列表
        Query query = new Query(params);
        List<SchoolEntity> shoolEntityList = this.baseMapper.queryList(query);
        Integer total = this.baseMapper.queryTotal(query);

        return new PageUtils(shoolEntityList, total, query.getLimit(), query.getCurrPage());
    }

    @Override
    public SchoolEntity queryObject(Integer id) {
        return this.baseMapper.queryObject(id);
    }

    @Override
    public List<SchoolEntity> queryList(Query query) {
        return this.baseMapper.queryList(query);
    }

    @Override
    public Boolean update(SchoolEntity shoolEntity) {
        return this.baseMapper.update(shoolEntity);
    }

    @Override
    public int querySchoolId(Long createUserId) {
        return this.baseMapper.querySchoolId(createUserId);
    }


}
